// 简单的类继承测试，不使用super
class Animal {
  constructor(name) {
    this.name = name;
  }
  
  speak() {
    return this.name + " makes a noise.";
  }
}

class Dog extends Animal {
  constructor(name) {
    // 手动设置name属性，不使用super
    this.name = name;
  }

  speak() {
    // 不使用super.speak()，直接实现
    return this.name + " barks.";
  }
}

// 测试基类
const animal = new Animal("Generic Animal");
console.log(animal.name);
console.log(animal.speak());

// 测试子类
const dog = new Dog("Rex");
console.log(dog.name);
console.log(dog.speak()); 